package com.example.partyfee.dto;

import com.fasterxml.jackson.annotation.JsonFormat;
import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.NotNull;
import jakarta.validation.constraints.Pattern;
import lombok.Data;

import java.time.LocalDate;

@Data
public class PartyMemberDTO {
    
    @NotBlank(message = "所在班级不能为空")
    private String className;
    
    @NotBlank(message = "职务不能为空")
    private String position;
    
    @NotBlank(message = "姓名不能为空")
    private String name;
    
    @NotBlank(message = "身份证号不能为空")
    @Pattern(regexp = "^[1-9]\\d{5}(18|19|20)\\d{2}(0[1-9]|1[0-2])(0[1-9]|[12]\\d|3[01])\\d{3}[0-9Xx]$", 
            message = "身份证号格式不正确")
    private String idCard;
    
    @NotBlank(message = "标识号不能为空")
    private String identifier;
    
    @NotNull(message = "入党时间不能为空")
    @JsonFormat(pattern = "yyyy-MM-dd")
    private LocalDate joinDate;
    
    @NotBlank(message = "职级不能为空")
    @Pattern(regexp = "^(校级干部|院级干部|班级干部|组长)$", message = "职级只能是：校级干部、院级干部、班级干部、组长")
    private String positionLevel;
} 